package technology.tabula.fx;
// Java program to create a path and
// add  multiple LineTo objects to it
// and display it
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.Stage;
import javafx.scene.layout.*;
import javafx.scene.paint.*;
import javafx.scene.text.*;
import javafx.geometry.*;
import javafx.scene.layout.*;
import javafx.scene.shape.*;
import javafx.scene.paint.*;
import javafx.scene.*;

public class LineTo_2 extends Application {

    // launch the application
    @Override
    public void start(Stage stage)
    {

        try {

            // set title for the stage
            stage.setTitle("LineTo");

            // create LineTo
            LineTo Lineto = new LineTo(300, 200);
            LineTo Lineto1 = new LineTo(200, 300);
            LineTo Lineto2 = new LineTo(100, 200);
            LineTo Lineto3 = new LineTo(200, 100);

            // create moveto
            MoveTo moveto = new MoveTo(200, 100);

            // create a Path
            Path path = new Path(moveto, Lineto,
                Lineto1, Lineto2, Lineto3);

            // set fill for path
            path.setFill(Color.GREEN);

            // set stroke width
            path.setStrokeWidth(2);

            // create a Group
            Group group = new Group(path);

            // create a scene
            Scene scene = new Scene(group, 400, 400);

            // set the scene
            stage.setScene(scene);

            stage.show();
        }

        catch (Exception e) {

            System.out.println(e.getMessage());
        }
    }

    // Main Method
    public static void main(String args[])
    {

        // launch the application
        launch(args);
    }
}
